<template>
  <div>
    <dv-border-box-8 style="width: 400px; height: 500px">
      <p
        style="
          width: 400px;
          height: 20px;
          text-align: center;
          line-height: 30px;
          color: white;
        "
      >
        实时体温数据
      </p>
      <dv-scroll-board
        :config="config"
        style="width: 390px; height: 460px; margin-left: 5px"
      />
    </dv-border-box-8>
  </div>
</template>
<script>
import AV from "leancloud-storage";
export default {
  data() {
    return {
      config: {},
    };
  },
  mounted() {
    this.getkeep();
  },
  methods: {
    getkeep() {
      const query = new AV.Query("type");
      query.find().then((res) => {
        //查询数据的回调，res是查询出来的数据
        // console.log("数据", res);

        var newArr = [];
        res.map(function (item) {
          var sevm = [];
          sevm.push(item.attributes.name);
          sevm.push(item.attributes.classes);
          sevm.push(item.attributes.time);
          sevm.push(item.attributes.value);
          // sevm["name"] = item.attributes.name;
          // sevm["classes"] = item.attributes.classes;
          // sevm["time"] = item.attributes.time;
          // sevm["value"] = item.attributes.value;
          newArr.push(sevm);
          // console.log(sevm);
        });
        // console.log("newarr", newArr);
        this.config = {
          header: ["姓名", "班级/角色", "时间", "体温"],
          data: newArr,
        };
      });
    },
  },
};
</script>
<style></style>
